package com.niuwa.p2p.dao.redenvelope;

import java.util.List;
import java.util.Map;

import com.niuwa.p2p.dao.MyBatisDao;
import com.niuwa.p2p.entity.redenvelope.RedEnvelopeRule;

@MyBatisDao
public interface RedEnvelopeRuleDao {
    int deleteByPrimaryKey(String ruleNo);

    int insert(RedEnvelopeRule record);

    /**
     * 根据规则编号查询是信息
     * @param ruleNo
     * @return
     */
    RedEnvelopeRule selectRedEnvelopeRuleByRuleNo(String ruleNo);
    
    /**
     * 根据规则名称查询是否存在规则
     * @param ruleNo
     * @return
     */
    int selectRedEnvelopeRuleByRuleName(String ruleName);

    int updateByPrimaryKeySelective(RedEnvelopeRule record);

    /**
     * 根据条件查询规则
     * @param map
     * @return
     */
    List<RedEnvelopeRule> selectByMap(Map map);
    
    /**
     * 根据条件获取所有未删除的规则信息
     * @param paramMap
     * @return
     */
    public List<RedEnvelopeRule> selectRuleByConditions(Map<String, Object> paramMap);
    
    /**
     * 根据条件查询所有未删除的规则的条数
     * @param paramMap
     * @return
     */
    public int selectCountRuleByConditions(Map<String, Object> paramMap);
}